package db.freebase;

public class FreeBaseTSVLine {

    public static final String VALUE_SEPARATOR = ",";
    public static final char FreeBaseTSVLineValueReplacement1Original = '\"';
    public static final char FreeBaseTSVLineValueReplacement1New = '\'';

    
    String[] line;
    
    public FreeBaseTSVLine(String[] line) {
        this.line = line;
    }
    
    public boolean isNull(int index) {
        if (index < 0 || index >= line.length) {
            return true;
        }
        return line[index].trim().isEmpty();
    }
    
    public boolean isValue(int index) {
        return !isNull(index);
    }
    
    public String[] getLine() {
        return line;
    }
    
    public String getValueAt(int index) {
        if (index < 0 || index >= line.length) {
            return null;
        }
        return line[index];
    }
    
    public String getMid() {
        return line[1];
    }
    
}
